# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import tools
from odoo import api, fields, models


class FHsaasMK_FHsaasTB(models.Model):
    _name = "FHsaasMK.FHsaasTB"
    _description = "FHsaasZW"
    _auto = False
    #_rec_name = 'fname'
    _order = 'id desc'

FHSAAS_columns 
    @api.model_cr
    def init(self):
        tools.drop_view_if_exists(self.env.cr, self._table)
        self.env.cr.execute("""CREATE or REPLACE VIEW %s as (
                    SELECT l."id" as "id",
                    l."fname" as "fname",
                    l."origin" as "origin",
                    l."FAddperson" as "FAddperson",
                    l."FConsultant" as "FConsultant",					
                    l."FAdddate" as "FAdddate",					
                    l."state" as "state",					
                    l."FDisable" as "FDisable"  FROM fhtest_weishui001  l  GROUP BY l."id"					
            )""" % (self._table))
